#include <iostream>
#include <fstream>
#include <Eigen/Dense>
#include <opencv4/opencv2/opencv.hpp>

using namespace Eigen;
using namespace std;
using namespace cv;

int main()
{
    //Eigen
    MatrixXd mat1(2, 3), mat2(3, 2), mat3(2, 2);
    mat1 << 1, 1, 1, 1, 1, 1;
    mat2 << 1, 4, 2, 5, 3, 6;

    cout << "BY EIGEN: mat1 * mat2 = " << mat1 * mat2 << endl;

    //OpenCV
    double A_num[2][3] = {{1, 1, 1}, {1, 1, 1}};
    double B_num[3][2] = {{1, 4}, {2, 5}, {3, 6}};
    Mat A(2, 3, CV_64F, A_num);
    Mat B(3, 2, CV_64F, B_num);

    cout << "BY OPENCV: mat1 * mat2 = " << A * B << endl;

    //Write the results into .txt File
    ofstream ofile;
    ofile.open("results.txt");
    ofile << "BY EIGEN: " << endl << mat1 * mat2 << endl << "BY OPENCV: " << endl << A * B << endl;
    ofile.close();

    return 0;
}